package com.wyy.ems_vue.dao;/*
 **
 * @author yangyang
 *@date 2022/07/02 22:41
 **/

import com.wyy.ems_vue.entity.Emp;
import org.apache.ibatis.annotations.*;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

@Mapper
public interface EmpDao {
   @Select("select id,name,path,salary,age from t_emp")
   List<Emp>  findAll();
   @Insert("insert  into t_emp values(#{id},#{name},#{path},#{salary},#{age})")
   @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
   void save(Emp emp);
   @Delete("delete from t_emp where id = #{id}")
   void delete(String id);
   @Select(" select id,name,path,salary,age from t_emp where id = #{id}")
   Emp findOne(String id);
   @Update(" update t_emp set name =#{name}, path = #{path}, salary = #{salary}, age = #{age} where id = #{id}")
   void  update(Emp emp);
}
